package com.kern.rpc.runtest;

import com.kern.rpc.bean.Student;
import com.kern.rpc.client.RpcClientProxy;
import com.kern.rpc.server.RpcServer;
import com.kern.rpc.service.IStudentService;

/**
 *  测试类
 * Created by caoshi at 20:36 2021-07-21
 */
public class RpcTestMain {


    public static void main(String[] args) {
        new Thread(() -> {
            try {
                RpcServer server = new RpcServer(12000);
                server.start();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }).start();

        RpcClientProxy proxy = new RpcClientProxy();
        IStudentService studentService = proxy.getProxy(IStudentService.class);

        Student info = studentService.getInfo();
        System.out.println(info.getName());


    }


}
